# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

# POLLUX BASE
include_directories(external/xxhash)
set(POLLUX_SRC
        ####################################### common ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/common/base/exceptions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/pollux_exception.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/admission_controller.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/bit_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/counters.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/fs.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/periodic_stats_reporter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/random_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/runtime_metrics.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/simd_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/skewed_partition_balancer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/spill_config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/spill_stats.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/stats_reporter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/succinct_printer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/trace_config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/bigint_id_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/base/status.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/async_data_cache.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/cache_ttl_controller.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/file_ids.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/scan_tracker.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/ssd_cache.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/ssd_file.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/ssd_file_tracker.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/caching/string_id_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/compression/compression.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/compression/lzo_decompressor.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/config/config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/encode/base64.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/exception/exception.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/exception/exceptions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/file.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/file_input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/file_systems.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/temp_directory_path.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/file/temp_file_path.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/hyperloglog/bias_correction.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/hyperloglog/dense_hll.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/hyperloglog/sparse_hll.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/hyperloglog/murmur3_hash128.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/io/io_statistics.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/allocation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/allocation_pool.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/arbitration_operation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/arbitration_participant.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/byte_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/hash_string_allocator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/malloc_allocator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/memory.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/memory_allocator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/memory_arbitrator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/memory_pool.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/mmap_allocator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/mmap_arena.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/raw_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/shared_arbitrator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/memory/stream_arena.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/process_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/stack_trace.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/thread_debug_info.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/trace_context.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/trace_history.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/process/profiler.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/strings/string_view.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/serialization/deserialization_registry.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/testutil/scoped_test_time.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/testutil/test_value.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/testutil/random_seed.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/time/cpu_wall_timer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/time/timer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/md5/md5.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/constrained_generators.cpp
        ${PROJECT_SOURCE_DIR}/pollux/common/utils.cpp
        ####################################### buffer ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/buffer/buffer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/buffer/string_view_buffer_holder.cpp
        ####################################### core ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/core/expressions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/core/plan_fragment.cpp
        ${PROJECT_SOURCE_DIR}/pollux/core/plan_node.cpp
        ${PROJECT_SOURCE_DIR}/pollux/core/query_config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/core/query_ctx.cpp
        ${PROJECT_SOURCE_DIR}/pollux/core/simple_function_metadata.cpp
        ####################################### functions ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/functions/function_registry.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/coverage_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/dynamic_library_loader.cpp
        ####################################### functions/lib ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/array_shuffle.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/check_duplicate_keys.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/check_nested_nulls.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/kll_sketch.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/map_concat.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/re2_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/repeat.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/slice.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/string_encoding_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/subscript_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/time_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/utf8_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/is_null.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/lambda_function_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/rows_translation_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/date_time_formatter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/date_time_formatter_builder.cpp
        ####################################### functions/lib/aggregates ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/average_aggregate_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/central_moments_aggregates_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/compare.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/min_max_aggregate_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/single_value_accumulator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/value_list.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/aggregates/value_set.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/window/nth_value.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/window/ntile.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/window/rank.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/lib/window/row_number.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/connector.cpp
        )
set(POLLUX_EXEC_SEC
        ####################################### exec ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/exec/addressable_non_null_value_list.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate_companion_adapter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate_companion_signatures.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate_function_registry.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate_info.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregation_masks.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/aggregate_window.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/arrow_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/assign_uniqueId.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/container_row_serde.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/distinct_aggregations.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/driver.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/enforce_single_row.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/exchange.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/exchange_client.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/exchange_queue.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/exchange_source.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/expand.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/filter_project.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/group_id.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/grouping_set.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_aggregation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_join_bridge.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_partition_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_probe.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/hash_table.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/index_lookup_join.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/join_bridge.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/limit.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/local_partition.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/local_planner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/mark_distinct.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/memory_reclaimer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/merge.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/merge_join.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/merge_source.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/nested_loop_join_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/nested_loop_join_probe.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/operator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/operator_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/order_by.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/output_buffer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/output_buffer_manager.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/operator_trace_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/operator_trace_scan.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/operator_trace_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/task_trace_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/task_trace_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/trace.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/trace_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/partitioned_output.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/partition_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/partition_streaming_window_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/plan_node_stats.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/prefix_sort.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/probe_operator_state.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/rows_streaming_window_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/row_container.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/row_number.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/scaled_scan_controller.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/scale_writer_local_partition.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/sort_buffer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/sorted_aggregations.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/sort_window_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/spill.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/spill_file.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/spiller.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/streaming_aggregation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/strings.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/table_scan.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/table_write_merge.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/table_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/task.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/top_n.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/top_n_row_number.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/unnest.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/values.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/vector_hasher.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/window.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/window_build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/window_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/window_partition.cpp
        ${PROJECT_SOURCE_DIR}/pollux/exec/cursor.cpp
        ####################################### serializers ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/serializers/compact_row_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/unsafe_row_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_batch_vector_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_header.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_iterative_vector_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_serializer_deserialization_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_serializer_estimation_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_serializer_serialization_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/presto_vector_lexer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/serializers/vector_stream.cpp
        ####################################### type ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/type/conversions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/decimal_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/filter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/floating_point_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/huge_int.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/subfield.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/timestamp.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/timestamp_conversion.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/tokenizer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/type.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/type_encoding_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/type_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/variant.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/hive/hive_type_parser.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/hive/hive_type_serializer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/tz/time_zone_database.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/tz/time_zone_links.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/tz/time_zone_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/type/tz/time_zone_names.cpp
        ####################################### vector ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/vector/base_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/complex_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/constant_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/constrained_vector_generator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/decoded_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/encoded_vector_copy.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/flat_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/generator_spec.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/lazy_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/selectivity_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/sequence_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/simple_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/string_vector_buffer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/variant_to_vector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_builder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_encoding.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_fuzzer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_maker.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_pool.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_printer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_saver.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/vector_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/vector/arrow/bridge.cpp
        ####################################### row ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/row/compact_row.cpp
        ${PROJECT_SOURCE_DIR}/pollux/row/unsafe_row_fast.cpp
        ####################################### flogs ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/flag_definitions/flags.cpp
        ####################################### external ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/external/date/tz.cpp
        ${PROJECT_SOURCE_DIR}/pollux/external/tzdb/chrono_exception.cpp
        ${PROJECT_SOURCE_DIR}/pollux/external/tzdb/time_zone.cpp
        ${PROJECT_SOURCE_DIR}/pollux/external/tzdb/tzdb_list.cpp
        ${PROJECT_SOURCE_DIR}/pollux/external/tzdb/tzdb.cpp
        ####################################### plan ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/plan/plan_builder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/plan/presto_sql.cpp
        ${PROJECT_SOURCE_DIR}/pollux/plan/reference_query_runner.cpp
        )
bison_target(
        TypeParser ${CMAKE_CURRENT_SOURCE_DIR}/type/parser/type_parser.yy ${CMAKE_CURRENT_SOURCE_DIR}/type/parser/type_parser.yy.cc
        DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/type/parser/type_parser.yy.h
        COMPILE_FLAGS "-Werror -Wno-deprecated")

flex_target(
        TypeParserScanner ${PROJECT_SOURCE_DIR}/pollux/type/parser/type_parser.ll ${PROJECT_SOURCE_DIR}/pollux/type/parser/scanner.cpp
        COMPILE_FLAGS "-Cf --prefix=polluxtp")

add_flex_bison_dependency(TypeParserScanner TypeParser)

kmcmake_cc_object(
        NAMESPACE pollux
        NAME type_parser
        SOURCES
        ${BISON_TypeParser_OUTPUTS}
        ${FLEX_TypeParserScanner_OUTPUTS}
        ${PROJECT_SOURCE_DIR}/pollux/type/parser/parser_util.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
)

set(POLLUX_RUNNER_SRC
        ${PROJECT_SOURCE_DIR}/pollux/runner/multi_fragment_plan.cpp
        ${PROJECT_SOURCE_DIR}/pollux/runner/local_runner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/runner/runner.cpp
        )

set(POLLUX_HDFS_SRC
        ${PROJECT_SOURCE_DIR}/pollux/external/hdfs/ArrowHdfsInternal.cpp
        )

set(POLLUX_EXPRESSION_SRC
        ${PROJECT_SOURCE_DIR}/pollux/expression/type_signature.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/function_signature.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/signature_binder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/reverse_signature_binder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/boolean_mix.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/cast_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/cast_hooks.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/coalesce_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/conjunct_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/constant_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/eval_ctx.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/expr_compiler.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/expr_to_subfield_filter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/field_reference.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/function_call_to_special_form.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/generic_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/lambda_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/peeled_encoding.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/presto_cast_hooks.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/register_special_form.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/row_constructor.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/simple_function_registry.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/special_form_registry.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/switch_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/try_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/expression/vector_function.cpp
        )
set(POLLUX_PARSER_SRC
        ${PROJECT_SOURCE_DIR}/pollux/parse/expressions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/parse/expressions_parser.cpp
        ${PROJECT_SOURCE_DIR}/pollux/parse/query_planner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/parse/type_resolver.cpp
        )
####################################### dwio/common ####################################################
set(POLLUX_DWIO_SRC
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/bit_concatenation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/bit_pack_decoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/buffered_input.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/cache_input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/cached_buffered_input.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/column_loader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/column_selector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/data_buffer_holder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/decoder_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/direct_buffered_input.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/direct_decoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/direct_input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/dwio_metrics_log.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/executor_barrier.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/file_sink.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/flat_map_helper.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/on_demand_unit_loader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/int_decoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/metadata_filter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/options.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/output_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/parallel_for.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/range.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/reader_factory.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/scan_spec.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/seekable_input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/selective_byte_rle_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/selective_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/selective_repeated_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/selective_struct_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/sorting_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/sorting_writer.h
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/throttler.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/type_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/type_with_id.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/writer_factory.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/compression/compression.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/compression/paged_input_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/compression/paged_output_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/common/encryption/encryption.cpp
        ####################################### dwio/catalog ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/dwio/catalog/hive/file_utils.cpp
        ####################################### dwio/dwrf ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/byte_rle.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/common.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/decryption.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/encryption.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/encryption_specification.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/file_metadata.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/int_encoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/rle_v1.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/rle_v2.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/common/statistics.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/binary_stream_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/dwrf_data.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/dwrf_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/flat_map_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/reader_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_dwrf_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_flat_map_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_integer_direct_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_integer_dictionary_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_string_direct_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_string_dictionary_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_timestamp_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_decimal_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_struct_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/selective_repeated_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/stream_labels.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/stripe_dictionary_cache.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/stripe_reader_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/reader/stripe_stream.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/utils/proto_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/column_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/flat_map_column_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/flush_policy.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/layout_planner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/ratio_tracker.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/statistics_builder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/statistics_builder_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/writer_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/writer_context.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/dwrf/writer/writer_sink.cpp
        ####################################### dwio/orc ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/dwio/orc/reader/orc_reader.cpp
        ####################################### dwio/parquet ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/common/bloom_filter.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/common/xx_hasher.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/common/level_comparison.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/common/level_conversion.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/metadata.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/nested_structure_decoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/parquet_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/parquet_type_with_id.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/page_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/parquet_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/parquet_data.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/repeated_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/rle_bp_decoder.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/struct_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/string_column_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/reader/semantic_version.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/thrift/ParquetThriftTypes.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/arrow_schema.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/arrow_schema_internal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/column_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/encoding.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/encryption.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/encryption_internal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/exception.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/file_encryptor_internal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/file_decryptor_internal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/file_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/metadata.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/page_index.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/path_internal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/platform.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/properties.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/schema.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/statistics.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/types.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/compression.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/compression_snappy.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/compression_zstd.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/compression_zlib.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/compression_lz4.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/hashing.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/writer/arrow/util/crc32.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/register_parquet_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/parquet/register_parquet_writer.cpp
        ####################################### dwio/text ####################################################
        ${PROJECT_SOURCE_DIR}/pollux/dwio/text/register_text_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/text/writer/text_writer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/dwio/text/writer/buffered_writer_sink.cpp
        )
set(POLLUX_TPCH_SRC
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/dbgen.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/dbgen_gunk.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/bm_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/build.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/permute.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/rnd.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/rng64.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/speed_seed.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/dbgen/text.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/db_gen_iterator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tpch/gen/tpch_gen.cpp
        )
set(POLLUX_PRESTO_SRC
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_constructor.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_contains.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_distinct.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_duplicates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_intersect_except.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_and_map_match.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_min_max_by.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_position.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_sort.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/array_sum.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/comparisons.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/decimal_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/element_at.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/filter_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/find_first.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/from_utf8.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/in_predicate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/map_entries.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/map_from_entries.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/map_keys_and_values.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/map_zip_with.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/not.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/reduce.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/reverse.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/row_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/sequence.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/simple_comparison_matcher.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/split.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/split_to_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/string_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/subscript.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/to_utf8.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/transform.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/transform_keys.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/transform_values.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/type_of.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/uri_parser.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/url_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/vector_arithmetic.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/width_bucket_array.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/zip.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/zip_with.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/approx_distinct_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/approx_most_frequent_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/approx_percentile_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/arbitrary_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/array_agg_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/average_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/bitwise_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/bitwise_xor_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/bool_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/central_moments_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/count_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/count_if_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/covariance_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/checksum_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/classification_aggregation.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/entropy_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/geometric_mean_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/histogram_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/map_agg_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/map_union_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/map_union_sum_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/max_size_for_stats_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/min_max_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/max_by_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/min_by_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/multi_map_agg_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/presto_hasher.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/reduce_agg.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/register_aggregate_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/set_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/sum_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/sum_data_size_for_stats_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/aggregates/variance_aggregates.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json/json_extractor.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json/json_path_tokenizer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json/json_string_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json/simd_json_extractor.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/json/simd_json_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/array_concat_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/array_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/array_n_grams_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/binary_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/bing_tile_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/bitwise_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/checked_arithmetic_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/comparison_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/date_time_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/data_size_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/general_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/hyper_log_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/integer_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/json_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/map_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/mathematical_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/mathematical_operators_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/probability_trigonometric_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/registration_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/string_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/tdigest_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/registration/url_functions_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/bing_tile_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/bing_tile_type.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/geometry_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/hyper_log_log_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/ip_address_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/ip_prefix_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/json_cast_operator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/json_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/tdigest_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/timestamp_with_time_zone_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/uuid_registration.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/types/utils/timestamp_with_time_zone_input_generator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/window/cume_dist.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/window/first_last_value.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/window/lead_lag.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/prestosql/window/window_functions_registration.cpp
        )
set(POLLUX_SPARK_SRC
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/array_get_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/array_sort.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/comparisons.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/concat_ws.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/decimal_arithmetic.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/decimal_ceil.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/decimal_compare.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/hash.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/in.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/least_greatest.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/make_timestamp.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/regex_functions.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/size.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/string.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/unscaled_value_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/average_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/bitwise_xor_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/bloom_filter_agg_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/central_moments_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/collect_list_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/collect_set_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/first_last_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/min_max_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/min_max_by_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/mode_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/register.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/regr_replacement_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/aggregates/sum_aggregate.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_array.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_binary.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_bitwise.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_comparison.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_datetime.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_json.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_map.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_math.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_misc.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_regexp.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register-special_form.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_string.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/registration/register_url.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/at_least_n_non_nulls.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/decimal_round.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/from_json.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/get_struct_field.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/make_decimal.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/spark_cast_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/specialforms/spark_cast_hooks.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/sparksql/window/window_functions_registration.cpp
)
set(POLLUX_REMOTE_SRC
        ${PROJECT_SOURCE_DIR}/pollux/functions/remote/client/thrift_client.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/remote/client/remote.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/remote/if/get_serde.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/remote/server/remote_function_service.cpp
        ${PROJECT_SOURCE_DIR}/pollux/functions/remote/utils/remote_function_service_provider.cpp
        )
set(POLLUX_CONNECTOR_HIVE_SRC
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/file_handle.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_config.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_connector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_connector_split.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_connector_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_data_sink.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_data_source.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_partition_function.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/hive_partition_util.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/partition_id_generator.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/split_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/table_handle.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/iceberg/iceberg_split_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/iceberg/iceberg_split.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/iceberg/positional_delete_file_reader.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/abfs/RegisterAbfsFileSystem.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/gcs/register_gcs_filesystem.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/hdfs/RegisterHdfsFileSystem.cpp
        ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/s3fs/RegisterS3FileSystem.cpp
        )
set(SUBSTRAIT_SRC
        ${PROJECT_SOURCE_DIR}/pollux/substrait/pollux_substrait_signature.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/pollux_to_substrait_plan.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/substrait_extension_collector.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/substrait_to_pollux_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/type_utils.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/pollux_to_substrait_expr.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/pollux_to_substrait_type.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/substrait_parser.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/substrait_to_pollux_plan.cpp
        ${PROJECT_SOURCE_DIR}/pollux/substrait/variant_to_vector_converter.cpp

)

set(TRACE_SRC
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/aggregation_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/filter_project_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/hash_join_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/operator_replayer_base.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/partitioned_output_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/table_scan_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/table_writer_replayer.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/trace_file_tool_runner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/trace_replayer_main.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/trace_replay_runner.cpp
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/trace_replay_task_runner.cpp
)

if(POLLUX_ENABLE_ABFS)
    set(POLLUX_CONNECTOR_HIVE_SRC
            ${POLLUX_CONNECTOR_HIVE_SRC}
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/abfs/AbfsConfig.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/abfs/AbfsWriteFile.cpp
            )
endif ()
if(POLLUX_ENABLE_GCS)
    set(POLLUX_CONNECTOR_HIVE_SRC
            ${POLLUX_CONNECTOR_HIVE_SRC}
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/gcs/gcs_filesystem.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/gcs/gcs_util.cpp
            )
endif ()
if(POLLUX_ENABLE_HDFS)
    set(POLLUX_CONNECTOR_HIVE_SRC
            ${POLLUX_CONNECTOR_HIVE_SRC}
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/hdfs/HdfsFileSystem.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/hdfs/HdfsReadFile.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/hdfs/HdfsWriteFile.cpp
            )
endif ()
if(POLLUX_ENABLE_S3)
    set(POLLUX_CONNECTOR_HIVE_SRC
            ${POLLUX_CONNECTOR_HIVE_SRC}
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/s3fs/S3FileSystem.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/s3fs/S3Util.cpp
            ${PROJECT_SOURCE_DIR}/pollux/connectors/hive/storage_adapters/s3fs/S3Config.cpp
            )
endif ()
set(POLLUX_CONNECTOR_TPCCH_SRC
        ${PROJECT_SOURCE_DIR}/pollux/connectors/tpch/tpch_connector.cpp
        )
####################################### duckdb ####################################################
set(POLLUX_DUCK_SRC
        ${PROJECT_SOURCE_DIR}/pollux/duckdb/conversion/duck_conversion.cpp
        ${PROJECT_SOURCE_DIR}/pollux/duckdb/conversion/duck_parser.cpp
        )

    set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_EXEC_SEC})
        set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_RUNNER_SRC})

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_DUCK_SRC})


if (POLLUX_ENABLE_HDFS)
    set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_HDFS_SRC})
endif ()

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_EXPRESSION_SRC})



bison_target(
        TypeCalculationParser ${PROJECT_SOURCE_DIR}/pollux/expression/type_calculation/type_calculation.yy
        ${PROJECT_SOURCE_DIR}/pollux/expression/type_calculation/type_calculation.yy.cc
        DEFINES_FILE ${PROJECT_SOURCE_DIR}/pollux/expression/type_calculation/type_calculation.yy.h
        COMPILE_FLAGS "-Werror -Wno-deprecated")

flex_target(
        TypeCalculationScanner ${PROJECT_SOURCE_DIR}/pollux/expression/type_calculation/type_calculation.ll
        ${PROJECT_SOURCE_DIR}/pollux/expression/type_calculation/scanner.cpp COMPILE_FLAGS "-Cf --prefix=polluxtc")
bison_target(
        SignatureParser ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/signature_parser.yy
        ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/signature_parser.yy.cc
        DEFINES_FILE ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/signature_parser.yy.h
        COMPILE_FLAGS "-Werror -Wno-deprecated")

flex_target(
        SignatureParserScanner ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/signature_parser.ll
        ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/scanner.cpp COMPILE_FLAGS "-Cf --prefix=polluxsp")
kmcmake_cc_object(
        NAMESPACE pollux
        NAME parse_object
        SOURCES
        ${BISON_SignatureParser_OUTPUTS}
        ${FLEX_SignatureParserScanner_OUTPUTS}
        ${BISON_TypeCalculationParser_OUTPUTS}
        ${FLEX_TypeCalculationScanner_OUTPUTS}
        ${PROJECT_SOURCE_DIR}/pollux/expression/signature_parser/parse_util.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
)

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_PARSER_SRC})
set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_DWIO_SRC})

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_TPCH_SRC})
set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_PRESTO_SRC})
set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_SPARK_SRC})
set(POLLUX_SRC ${POLLUX_SRC} ${SUBSTRAIT_SRC})
#set(POLLUX_SRC ${POLLUX_SRC}  ${TRACE_SRC})

if(POLLUX_ENABLE_REMOTE_FUNCTIONS)
    set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_REMOTE_SRC})
endif()

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_CONNECTOR_HIVE_SRC})

set(POLLUX_SRC ${POLLUX_SRC} ${POLLUX_CONNECTOR_TPCCH_SRC})

kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME pollux
        SOURCES
        ${POLLUX_SRC}
        OBJECTS
        parse_object
        dwrf_object
        type_parser
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        ${KMCMAKE_DEPS_LINK}
        PUBLIC
)
#[[
kmcmake_cc_binary(
        NAMESPACE ${PROJECT_NAME}
        NAME pollux
        SOURCES
        ${PROJECT_SOURCE_DIR}/pollux/tool/trace/trace_replayer_main.cpp
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        pollux::pollux_static
        ${KMCMAKE_DEPS_LINK}
)
]]

if(KMCMAKE_BUILD_TEST OR KMCMAKE_BUILD_BENCHMARK OR KMCMAKE_BUILD_EXAMPLES)
        file(GLOB_RECURSE SRC "testing/*.cpp" "testing/*.cc")
        find_package(cpr REQUIRED)
        find_package(GTest REQUIRED)
        kmcmake_cc_library(
                NAMESPACE ${PROJECT_NAME}
                NAME pollux_testing
                SOURCES
                ${SRC}
                OBJECTS
                type_parser
                CXXOPTS
                ${KMCMAKE_CXX_OPTIONS}
                PLINKS
                cpr::cpr
                pollux::pollux_static
                GTest::gtest
                ${KMCMAKE_DEPS_LINK}
                PUBLIC
        )
endif ()
#[[
add_library(pollux_object OBJECT ${POLLUX_SRC})
add_library(pollux_static STATIC $<TARGET_OBJECTS:pollux_object> ${objs})
target_compile_options(pollux_object PRIVATE -Wno-deprecated-declarations ${KSIMD_ARCH_OPTION})
target_link_directories(pollux_static PUBLIC ${DEPS_LIB})

install(TARGETS pollux_static DESTINATION lib)
if (POLLUX_ENABLE_GPU)
    add_subdirectory(experimental/gpu)
    add_subdirectory(experimental/wave)
    add_subdirectory(external/jitify)
endif ()

# substrait converter
if (POLLUX_ENABLE_SUBSTRAIT)
    add_subdirectory(substrait)
endif ()

if (POLLUX_BUILD_PYTHON_PACKAGE)
    add_subdirectory(python)
endif ()
]]